Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sozo): scaffold ts base files on user behalf #2275

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MartianGreed
Copy link
Contributor

@MartianGreed MartianGreed commented Aug 8, 2024

Description

As a developper when I start a new project I don't want to copy/paste or type by hand every dojo files required for the project to run.

I want to be able to have a command to scaffold dojo files in order to ease project starting and be able to choose the frontend architecture I want.

Related issue

Tests

  • Yes, but incomplete as I need guidance through building process

Added to documentation?

I have documented the code itself + PR here on dojo.js

Checklist

  • I've formatted my code (scripts/prettier.sh, scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • I've commented my code
  • I've requested a review after addressing the comments

Summary by CodeRabbit

  • New Features

    • Introduced a new command-line option for building projects to generate TypeScript scaffolding files.
    • Added a TypescriptScaffoldPlugin to facilitate TypeScript code generation.
    • New TypeScript templates for client components, client models, setup, systems, and world creation.
  • Bug Fixes

    • Improved error handling in the TypeScript scaffolding plugin.
  • Tests

    • Added asynchronous unit tests for the TypescriptScaffoldPlugin to ensure correct functionality.

Copy link

coderabbitai bot commented Aug 8, 2024

Walkthrough

Ohayo, sensei! The recent changes introduce a scaffold option in the build command, which facilitates the automatic generation of TypeScript scaffolding files. This enhancement includes the integration of the TypescriptScaffoldPlugin into the dojo-bindgen crate, streamlining the creation of essential TypeScript files. A variety of templates for client components, models, and setup processes have been defined, significantly improving modularity and the developer experience when building Dojo applications.

Changes

Files Change Summary
bin/sozo/src/commands/build.rs Added scaffold boolean field to BuildArgs for TypeScript scaffolding. Updated command-line argument handling and default initialization.
crates/dojo-bindgen/Cargo.toml Introduced lazy_static and tera dependencies for static variable management and templating capabilities.
crates/dojo-bindgen/src/lib.rs, crates/dojo-bindgen/src/plugins/mod.rs Added TypescriptScaffoldPlugin to PluginManager and introduced typescript_scaffold module with TypescriptScaffold variant in BuiltinPlugins.
crates/dojo-bindgen/src/plugins/typescript_scaffold/mod.rs Implemented TypescriptScaffoldPlugin, utilizing Tera templates for generating TypeScript code with methods for various file types.
crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/*.tpl.ts Added various TypeScript templates (e.g., clientComponents, clientModels, setup, system, world) to support scaffolding for Dojo applications.
crates/dojo-bindgen/src/plugins/typescript_scaffold/tests.rs Created unit tests for TypescriptScaffoldPlugin to verify code generation and file validity.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant BuildArgs
    participant PluginManager
    participant TypescriptScaffoldPlugin
    participant Tera

    User->>CLI: Initiates build command with --scaffold
    CLI->>BuildArgs: Parses command with scaffold=true
    BuildArgs->>PluginManager: Adds TypescriptScaffoldPlugin
    PluginManager->>TypescriptScaffoldPlugin: Creates instance
    TypescriptScaffoldPlugin->>Tera: Loads templates
    TypescriptScaffoldPlugin->>User: Generates TypeScript files
Loading

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 10592c0 and 86e3aef.

Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing (11)
  • bin/sozo/src/commands/build.rs (3 hunks)
  • crates/dojo-bindgen/Cargo.toml (1 hunks)
  • crates/dojo-bindgen/src/lib.rs (2 hunks)
  • crates/dojo-bindgen/src/plugins/mod.rs (3 hunks)
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/mod.rs (1 hunks)
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/clientComponents.tpl.ts (1 hunks)
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/clientModels.tpl.ts (1 hunks)
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/setup.tpl.ts (1 hunks)
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/system.tpl.ts (1 hunks)
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/world.tpl.ts (1 hunks)
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/tests.rs (1 hunks)
Files skipped from review due to trivial changes (2)
  • crates/dojo-bindgen/Cargo.toml
  • crates/dojo-bindgen/src/plugins/mod.rs
Files skipped from review as they are similar to previous changes (4)
  • bin/sozo/src/commands/build.rs
  • crates/dojo-bindgen/src/lib.rs
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/mod.rs
  • crates/dojo-bindgen/src/plugins/typescript_scaffold/tests.rs
Additional context used
Biome
crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/world.tpl.ts

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/clientModels.tpl.ts

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/clientComponents.tpl.ts

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/system.tpl.ts

[error] 27-27: Expected a statement but instead found '%'.

Expected a statement here.

(parse)


[error] 27-27: expected ( but instead found system

Remove system

(parse)


[error] 27-27: Expected an expression but instead found '}'.

Expected an expression here.

(parse)


[error] 28-28: Expected an identifier, a member name, or a rest pattern but instead found '{ system.name'.

Expected an identifier, a member name, or a rest pattern here.

(parse)


[error] 28-28: Object and Array patterns require initializers.

This pattern is declared, but it is not given an initialized value.

(parse)


[error] 28-28: Expected a statement but instead found '= async (account: AccountInterface) =>'.

Expected a statement here.

(parse)


[error] 32-32: Expected a statement but instead found '% endfor %'.

Expected a statement here.

(parse)


[error] 33-33: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{% for system in systems %'.

Expected a property, a shorthand property, a getter, a setter, or a method here.

(parse)


[error] 33-33: Expected a semicolon or an implicit semicolon after a statement, but found none

An explicit or implicit semicolon is expected here...

...Which is required to end this statement

(parse)


[error] 33-33: Expected a statement but instead found ','.

Expected a statement here.

(parse)


[error] 33-33: Expected a statement but instead found '% endfor %'.

Expected a statement here.

(parse)


[error] 34-34: Expected a statement but instead found '}'.

Expected a statement here.

(parse)


[error] 36-38: Illegal return statement outside of a function

(parse)


[error] 38-39: Expected a statement but instead found '}'.

Expected a statement here.

(parse)


[error] 30-30: This code is unreachable

... because this statement will throw an exception beforehand

(lint/correctness/noUnreachable)


[error] 33-33: This code is unreachable

... because this statement will throw an exception beforehand

(lint/correctness/noUnreachable)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


[error] 27-27: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


[error] 28-30: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/setup.tpl.ts

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

Additional comments not posted (3)
crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/world.tpl.ts (1)

1-1: Remove the redundant block statement.

Ohayo, sensei! The block statement at the top is unnecessary and can be safely removed to simplify the code.

-{{ header }}
Tools
Biome

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/clientModels.tpl.ts (1)

1-1: Remove the redundant block statement.

Ohayo, sensei! The block statement at the top is unnecessary and can be safely removed to simplify the code.

-{{ header }}
Tools
Biome

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/clientComponents.tpl.ts (1)

1-1: Remove the redundant block statement.

Ohayo, sensei! The block statement at the top is unnecessary and can be safely removed to simplify the code.

-{{ header }}
Tools
Biome

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Outside diff range, codebase verification and nitpick comments (7)
crates/dojo-bindgen/src/plugins/typescript_scaffold/tests.rs (2)

7-18: Consider verifying all expected keys in the test.

The test test_generate_code_contains_all_keys checks if the result contains five keys, but it doesn't verify the specific keys expected. Consider asserting the presence of each key to ensure comprehensive testing.

assert!(res.contains_key("setup.ts"));
assert!(res.contains_key("world.ts"));
assert!(res.contains_key("system.ts"));
assert!(res.contains_key("clientModels.ts"));
assert!(res.contains_key("clientComponents.ts"));

20-33: Ensure the test checks the content of the system file.

The test test_handle_system currently retrieves the system file but does not verify its content. Consider adding assertions to check if the content matches expected patterns or values.

assert!(system.contains("expected content or pattern"));
crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/setup.tpl.ts (2)

26-39: Consider improving error messages for clarity.

The error messages in the setup function could provide more context for easier debugging. Consider including more details about the failure context.

- console.error("Failed to create torii client:", e);
+ console.error("Failed to create torii client with config:", config, "Error:", e);

116-117: Improve error message for active account retrieval.

The error message when failing to get the active account could be more descriptive to aid in debugging.

- throw new Error("failed to get active account");
+ throw new Error("Failed to retrieve active account from burner manager.");
crates/dojo-bindgen/src/plugins/typescript_scaffold/mod.rs (2)

14-23: Consider using logging instead of println for errors.

Using a logging library instead of println! for error messages can provide more control over log levels and outputs.

log::error!("Parsing error(s): {}", e);

47-56: Clarify the generated header comment.

The header comment generated for files could be more informative. Consider adding more details about the purpose of the file or the context in which it was generated.

- // Generated by dojo-bindgen on {}.
+ // This file was generated by dojo-bindgen on {} as part of the TypeScript scaffolding process.
bin/sozo/src/commands/build.rs (1)

31-33: Document the scaffold argument clearly.

The scaffold argument is added to enable Typescript scaffolding. Ensure the help documentation is clear and concise for users.

-  #[arg(help = "Generate Typescript scaffolding files.")]
+  #[arg(help = "Enable the generation of TypeScript scaffolding files.")]

@@ -0,0 +1,5 @@
{{ header }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant block statement.

The block statement at the top of the file is unnecessary and can be safely removed to simplify the code.

-{{ header }}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{ header }}
Tools
Biome

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

@@ -0,0 +1,17 @@
{{ header }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant block statement.

The block statement at the top of the file is unnecessary and can be safely removed to simplify the code.

-{{ header }}

Committable suggestion was skipped due to low confidence.

Tools
Biome

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

@@ -0,0 +1,15 @@
{{ header }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant block statement.

The block statement at the top of the file is unnecessary and can be safely removed to simplify the code.

-{{ header }}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{{ header }}
Tools
Biome

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

Comment on lines 61 to 68
fn handle_file(&self, path: &str, mut ctx: tera::Context) -> String {
ctx.insert("header", &self.header().as_str());
self.templates.render(path, &ctx).unwrap()
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle template rendering errors gracefully.

Currently, unwrap() is used for template rendering, which can cause a panic if an error occurs. Consider handling this error more gracefully.

self.templates.render(path, &ctx).unwrap_or_else(|e| {
    log::error!("Failed to render template {}: {}", path, e);
    String::new()
})

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (2)
crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/setup.tpl.ts (2)

1-1: Remove redundant block statement.

The { header } block statement doesn't serve any purpose and can be safely removed to simplify the code.

- {{ header }}
Tools
Biome

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


36-39: Enhance error logging for better debugging.

Consider adding more context to error messages to improve debugging. For example, include the function or module name in the log.

- console.error("Failed to create torii client:", e);
+ console.error("setup: Failed to create torii client:", e);

- console.error("Failed to create client:", e);
+ console.error("setup: Failed to create client:", e);

- console.log("Failed to create burner manager:", e);
+ console.error("setup: Failed to create burner manager:", e);

Also applies to: 76-78, 98-100

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (1)
crates/dojo-bindgen/src/plugins/typescript_scaffold/templates/setup.tpl.ts (1)

1-1: Remove redundant block statement.

Ohayo, sensei! The block statement {{ header }} at the beginning of the file doesn't serve any purpose and can be safely removed to simplify the code.

-{{ header }}
Tools
Biome

[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.

(lint/complexity/noUselessLoneBlockStatements)


[error] 1-1: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

Comment on lines +27 to +34
{% for system in systems %}
const {{ system.name }} = async (account: AccountInterface) => {
throw new Error("Not implemented");
};

{% endfor %}
return { {% for system in systems %} {{ system.name }}, {% endfor %} };
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct template syntax for TypeScript compatibility.

Ohayo, sensei! The current template syntax is causing parsing errors. Ensure that the {% ... %} tags generate valid TypeScript code. Consider using template helpers or functions to encapsulate logic. This will help avoid syntax errors and improve maintainability.

If you need assistance with this, let me know!

Tools
Biome

[error] 27-27: Expected a statement but instead found '%'.

Expected a statement here.

(parse)


[error] 27-27: expected ( but instead found system

Remove system

(parse)


[error] 27-27: Expected an expression but instead found '}'.

Expected an expression here.

(parse)


[error] 28-28: Expected an identifier, a member name, or a rest pattern but instead found '{ system.name'.

Expected an identifier, a member name, or a rest pattern here.

(parse)


[error] 28-28: Object and Array patterns require initializers.

This pattern is declared, but it is not given an initialized value.

(parse)


[error] 28-28: Expected a statement but instead found '= async (account: AccountInterface) =>'.

Expected a statement here.

(parse)


[error] 32-32: Expected a statement but instead found '% endfor %'.

Expected a statement here.

(parse)


[error] 33-33: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '{% for system in systems %'.

Expected a property, a shorthand property, a getter, a setter, or a method here.

(parse)


[error] 33-33: Expected a semicolon or an implicit semicolon after a statement, but found none

An explicit or implicit semicolon is expected here...

...Which is required to end this statement

(parse)


[error] 33-33: Expected a statement but instead found ','.

Expected a statement here.

(parse)


[error] 33-33: Expected a statement but instead found '% endfor %'.

Expected a statement here.

(parse)


[error] 34-34: Expected a statement but instead found '}'.

Expected a statement here.

(parse)


[error] 30-30: This code is unreachable

... because this statement will throw an exception beforehand

(lint/correctness/noUnreachable)


[error] 33-33: This code is unreachable

... because this statement will throw an exception beforehand

(lint/correctness/noUnreachable)


[error] 27-27: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)


[error] 28-30: This block statement doesn't serve any purpose and can be safely removed.

Standalone block statements without any block-level declarations are redundant in JavaScript and can be removed to simplify the code.
Safe fix: Remove redundant block.

(lint/complexity/noUselessLoneBlockStatements)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant